4D Analytics

Embedded Analytical Viewer

The Analytical viewer is a service that can be embedded within other products to display time series data in interactive engineering charts.

The Analytical Viewer service can be requested based on a 4D Analytics deployment specific to a project, or alternatively via an Assetwise Common Service cluster – meaning no deployment of 4D Analytics is required to use this service/feature, simply an endpoint location.

In terms of the data shown within the Analytical Viewer, there are 2 ways this can be done:

  • Data can live within the SQL Server 4D Analytics database (in some cases Influx DB, High Volume Data).
  • The data can be passed along with the request to the viewer as part of the body of a POST request (in json), which means that, in addition to no new software requirements/licenses, there is no configuration requirement within 4D Analytics; this really is a chart as a service.

Authentication – all applications using the viewer must be authenticated to employ and display the Analytical Viewer, and this can be done in a variety of ways. The chart is very friendly to Bentley’s preferred authentication processes.

The Analytical Viewer supports IMS/OIDC/Ping/Session/Active Directory and standard SQL logins. If you want to display a login box prior to presenting the viewer in your application, you can ignore the next section, but most will want to activate seamless authentication.

Seamless Authentication – This is critical to embedding the Analytical Viewer in other applications. Logging into another application within an application is not desirable.

Seamless authentication can work in one of 2 ways:

  • The parent application – the application hosting the Analytical Viewer (usually within an iFrame) uses the same authentication process as the version of the Analytical Viewer being referenced. For instance, if the parent application uses OIDC to authenticate and the Analytical Viewer uses OIDC, the login will be seamless; all authentication hurdles have already been cleared. However, if the parent application is authenticating against Session and the Analytical Viewer uses Ping or OIDC, then you will be presented with a login box. Both systems need to be the same.
  • You can send the authentication details along with the request for the service; this can be done in both a GET or POST request. Details of how to do this are shown below.
    • This method requires OIDC/Ping authentication to be in place as the parameters being passed to the viewer are tokens relative to this process.

Get Request Procedure:

  1. Open a browser and enter http://<websiteURL>/engineeringChart.jsp? (replace <websiteURL> with your URL) in the address line.
  2. Add display/content parameters to the address line. For both GET and POST Requests, URL parameters can be sent in order to alter the display/contents of the chart when loaded.
    • For example, &showDataValues=true – use this parameter to display the numerical quantity of a presented value atop the representation in the chart.
      • The current list of parameters includes:
        • &thePointIdents=6:7
        • &thePointAttributes=abc:def:ghi – requires a point to have an attribute of AVPointMapping with a value of abc
        • &StartDate=2019-01-01
        • &EndDate=2019-12-01
        • &DisplayFullPath=true/false
        • &showTools=true/false
        • &showLegend=true/false
        • &GraphType=Raw/Minimum/Maximum/Average/Sum/Count
        • &Resolution=Hour/Day/Week/Month/Quarter/Year
        • &SplitAxes=true/false
        • &ComparisonStart=2018-01-01
        • &RegressionType=Polynomial/Linear/None
        • &YScaling=Linear/Logarithmic
        • &ShowLogBooks=true/false
        • &ShowAlarmLevels=true/false
        • &SetChartTypes=line/column/area/scatter/spline/areaspline
        • &oidcToken=XYZABC
        • &showDataValues=true
        • &ShowChartValues=true
  3. Add &OidcToken=XXXXX to the address line (replace these Xs with your token).
  4. Strike the Enter key to send you Get Request and display the resulting Analytical Viewer.

Post Request Procedure:

  1. Open a browser and enter http://<websiteURL>/engineeringChart.jsp?datasource=included (replace <websiteURL> with your URL) in the address line.
  2. Add display/content parameters to the address line.
    • For example, &DisplayFullPath=false&SetChartTypes=column&ShowLogBooks=false&showDataValues=true
      • • &DisplayFullPath=false – use this parameter to add a point's Tree Navigator location its name in the Legend
      • • &SetChartTypes=column – use this parameter to set the Chart Type to the column option (other options are line, area, spline, and areaspline)
      • • &ShowLogBooks=false – use this parameter to hide log books on the chart
      • • &showDataValues=true – use this parameter to display the numerical quantity of a presented value atop the representation in the chart
  3. Add &OidcToken=XXXXX to the address line (replace these Xs with your token).
    • You can use the website https://jwt.io to verify the correct format and validity of bearer tokens.
  4. Strike the Enter key to send you Get Request and display the resulting Analytical Viewer.

The Request Test:

Use the Request Test page to simulate a Get or Post Request and view the resulting Engineering Chart.

  1. Open a browser window and enter https://<websiteURL>/RequestTest.jsp. (replace <websiteURL> with your URL).
  2. On the RequestTest page, expand the Request Type drop-down and choose from the available options.
  3. In the Target URL field, enter http://<websiteURL>/engineeringChart.jsp.
  4. In the Parameters field, enter datasource=included.
  5. Paste the body of your request in the text box then click the Submit button.
  6. The Analytical Viewer opens with the included data.